
// Copyright (C) 2009-2011 Luca Piccioni
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;

#pragma warning disable 1572, 1573

namespace Derm.OpenGL {

	/// <summary>
	/// Implementation of the OpenGL specification 
	/// </summary>
	public unsafe partial class Wgl : ProcLoader
	{

		/// <summary>
		/// Binding for wglBindSwapBarrierNV function.
		/// </summary>
		/// <param name="group">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="barrier">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean BindSwapBarrierNV(UInt32 group, UInt32 barrier) {
			Boolean retvalue;
			if      (Delegates.pwglBindSwapBarrierNV != null)
				retvalue = (Delegates.pwglBindSwapBarrierNV(group, barrier));
			else
				throw new InvalidOperationException("binding point BindSwapBarrierNV cannot be found");
			LogProc("wglBindSwapBarrierNV({0}, {1}) = {2}", group, barrier, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglBindVideoCaptureDeviceNV function.
		/// </summary>
		/// <param name="uVideoSlot">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="hDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean BindVideoCaptureDeviceNV(UInt32 uVideoSlot, IntPtr hDevice) {
			Boolean retvalue;
			if      (Delegates.pwglBindVideoCaptureDeviceNV != null)
				retvalue = (Delegates.pwglBindVideoCaptureDeviceNV(uVideoSlot, hDevice));
			else
				throw new InvalidOperationException("binding point BindVideoCaptureDeviceNV cannot be found");
			LogProc("wglBindVideoCaptureDeviceNV({0}, {1}) = {2}", uVideoSlot, hDevice, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglBindVideoDeviceNV function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uVideoSlot">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="hVideoDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="piAttribList">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static Boolean BindVideoDeviceNV(IntPtr hDC, UInt32 uVideoSlot, IntPtr hVideoDevice, int[] piAttribList) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piAttribList = piAttribList)
				{
					if      (Delegates.pwglBindVideoDeviceNV != null)
						retvalue = (Delegates.pwglBindVideoDeviceNV(hDC, uVideoSlot, hVideoDevice, fp_piAttribList));
					else
						throw new InvalidOperationException("binding point BindVideoDeviceNV cannot be found");
				}
			}
			LogProc("wglBindVideoDeviceNV({0}, {1}, {2}, {3}) = {4}", hDC, uVideoSlot, hVideoDevice, piAttribList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglBindVideoImageNV function.
		/// </summary>
		/// <param name="hVideoDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hPbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iVideoBuffer">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static Boolean BindVideoImageNV(IntPtr hVideoDevice, IntPtr hPbuffer, int iVideoBuffer) {
			Boolean retvalue;
			if      (Delegates.pwglBindVideoImageNV != null)
				retvalue = (Delegates.pwglBindVideoImageNV(hVideoDevice, hPbuffer, iVideoBuffer));
			else
				throw new InvalidOperationException("binding point BindVideoImageNV cannot be found");
			LogProc("wglBindVideoImageNV({0}, {1}, {2}) = {3}", hVideoDevice, hPbuffer, iVideoBuffer, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglBlitContextFramebufferAMD function.
		/// </summary>
		/// <param name="dstCtx">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="srcX0">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="srcY0">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="srcX1">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="srcY1">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dstX0">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dstY0">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dstX1">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dstY1">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="mask">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="filter">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void BlitContextFramebufferAMD(IntPtr dstCtx, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, uint mask, int filter) {
			if      (Delegates.pwglBlitContextFramebufferAMD != null)
				Delegates.pwglBlitContextFramebufferAMD(dstCtx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
			else
				throw new InvalidOperationException("binding point BlitContextFramebufferAMD cannot be found");
			LogProc("wglBlitContextFramebufferAMD({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10})", dstCtx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
		}

		/// <summary>
		/// Binding for wglChoosePixelFormat function.
		/// </summary>
		/// <param name="hDc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pPfd">
		/// A <see cref="T:PIXELFORMATDESCRIPTOR"/>.
		/// </param>
		public static int ChooseGdiPixelFormat(IntPtr hDc, out PIXELFORMATDESCRIPTOR pPfd) {
			int retvalue;
			unsafe {
				fixed (PIXELFORMATDESCRIPTOR* fp_pPfd = &pPfd)
				{
					if      (Delegates.pwglChoosePixelFormat != null)
						retvalue = (Delegates.pwglChoosePixelFormat(hDc, fp_pPfd));
					else
						throw new InvalidOperationException("binding point ChooseGdiPixelFormat cannot be found");
				}
			}
			LogProc("wglChoosePixelFormat({0}, {1}) = {2}", hDc, pPfd, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCopyContext function.
		/// </summary>
		/// <param name="hglrcSrc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hglrcDst">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="mask">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean CopyContext(IntPtr hglrcSrc, IntPtr hglrcDst, UInt32 mask) {
			Boolean retvalue;
			if      (Delegates.pwglCopyContext != null)
				retvalue = (Delegates.pwglCopyContext(hglrcSrc, hglrcDst, mask));
			else
				throw new InvalidOperationException("binding point CopyContext cannot be found");
			LogProc("wglCopyContext({0}, {1}, {2}) = {3}", hglrcSrc, hglrcDst, mask, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCopyImageSubDataNV function.
		/// </summary>
		/// <param name="hSrcRC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="srcName">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="srcTarget">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="srcLevel">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="srcX">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="srcY">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="srcZ">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="hDstRC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="dstName">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="dstTarget">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dstLevel">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dstX">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dstY">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dstZ">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="width">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="height">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="depth">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static Boolean CopyImageSubDataNV(IntPtr hSrcRC, UInt32 srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, IntPtr hDstRC, UInt32 dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, Int32 width, Int32 height, Int32 depth) {
			Boolean retvalue;
			if      (Delegates.pwglCopyImageSubDataNV != null)
				retvalue = (Delegates.pwglCopyImageSubDataNV(hSrcRC, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, hDstRC, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth));
			else
				throw new InvalidOperationException("binding point CopyImageSubDataNV cannot be found");
			LogProc("wglCopyImageSubDataNV({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}) = {17}", hSrcRC, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, hDstRC, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCreateAffinityDCNV function.
		/// </summary>
		/// <param name="phGpuList">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		public static IntPtr CreateAffinityDCNV(IntPtr[] phGpuList) {
			IntPtr retvalue;
			unsafe {
				fixed (IntPtr* fp_phGpuList = phGpuList)
				{
					if      (Delegates.pwglCreateAffinityDCNV != null)
						retvalue = (Delegates.pwglCreateAffinityDCNV(fp_phGpuList));
					else
						throw new InvalidOperationException("binding point CreateAffinityDCNV cannot be found");
				}
			}
			LogProc("wglCreateAffinityDCNV({0}) = {1}", phGpuList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCreateAssociatedContextAMD function.
		/// </summary>
		/// <param name="id">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static IntPtr CreateAssociatedContextAMD(UInt32 id) {
			IntPtr retvalue;
			if      (Delegates.pwglCreateAssociatedContextAMD != null)
				retvalue = (Delegates.pwglCreateAssociatedContextAMD(id));
			else
				throw new InvalidOperationException("binding point CreateAssociatedContextAMD cannot be found");
			LogProc("wglCreateAssociatedContextAMD({0}) = {1}", id, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCreateAssociatedContextAttribsAMD function.
		/// </summary>
		/// <param name="id">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="hShareContext">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="attribList">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static IntPtr CreateAssociatedContextAttribsAMD(UInt32 id, IntPtr hShareContext, int[] attribList) {
			IntPtr retvalue;
			unsafe {
				fixed (int* fp_attribList = attribList)
				{
					if      (Delegates.pwglCreateAssociatedContextAttribsAMD != null)
						retvalue = (Delegates.pwglCreateAssociatedContextAttribsAMD(id, hShareContext, fp_attribList));
					else
						throw new InvalidOperationException("binding point CreateAssociatedContextAttribsAMD cannot be found");
				}
			}
			LogProc("wglCreateAssociatedContextAttribsAMD({0}, {1}, {2}) = {3}", id, hShareContext, attribList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCreateContext function.
		/// </summary>
		/// <param name="hDc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static IntPtr CreateContext(IntPtr hDc) {
			IntPtr retvalue;
			if      (Delegates.pwglCreateContext != null)
				retvalue = (Delegates.pwglCreateContext(hDc));
			else
				throw new InvalidOperationException("binding point CreateContext cannot be found");
			LogProc("wglCreateContext({0}) = {1}", hDc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCreateLayerContext function.
		/// </summary>
		/// <param name="hDc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="level">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static IntPtr CreateLayerContext(IntPtr hDc, int level) {
			IntPtr retvalue;
			if      (Delegates.pwglCreateLayerContext != null)
				retvalue = (Delegates.pwglCreateLayerContext(hDc, level));
			else
				throw new InvalidOperationException("binding point CreateLayerContext cannot be found");
			LogProc("wglCreateLayerContext({0}, {1}) = {2}", hDc, level, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDeleteAssociatedContextAMD function.
		/// </summary>
		/// <param name="hglrc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean DeleteAssociatedContextAMD(IntPtr hglrc) {
			Boolean retvalue;
			if      (Delegates.pwglDeleteAssociatedContextAMD != null)
				retvalue = (Delegates.pwglDeleteAssociatedContextAMD(hglrc));
			else
				throw new InvalidOperationException("binding point DeleteAssociatedContextAMD cannot be found");
			LogProc("wglDeleteAssociatedContextAMD({0}) = {1}", hglrc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDeleteContext function.
		/// </summary>
		/// <param name="oldContext">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean DeleteContext(IntPtr oldContext) {
			Boolean retvalue;
			if      (Delegates.pwglDeleteContext != null)
				retvalue = (Delegates.pwglDeleteContext(oldContext));
			else
				throw new InvalidOperationException("binding point DeleteContext cannot be found");
			LogProc("wglDeleteContext({0}) = {1}", oldContext, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDeleteDCNV function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean DeleteDCNV(IntPtr hdc) {
			Boolean retvalue;
			if      (Delegates.pwglDeleteDCNV != null)
				retvalue = (Delegates.pwglDeleteDCNV(hdc));
			else
				throw new InvalidOperationException("binding point DeleteDCNV cannot be found");
			LogProc("wglDeleteDCNV({0}) = {1}", hdc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDescribeLayerPlane function.
		/// </summary>
		/// <param name="hDc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pixelFormat">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="layerPlane">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="nBytes">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="plpd">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean DescribeLayerPlane(IntPtr hDc, int pixelFormat, int layerPlane, UInt32 nBytes, out IntPtr plpd) {
			Boolean retvalue;
			unsafe {
				fixed (IntPtr* fp_plpd = &plpd)
				{
					if      (Delegates.pwglDescribeLayerPlane != null)
						retvalue = (Delegates.pwglDescribeLayerPlane(hDc, pixelFormat, layerPlane, nBytes, fp_plpd));
					else
						throw new InvalidOperationException("binding point DescribeLayerPlane cannot be found");
				}
			}
			LogProc("wglDescribeLayerPlane({0}, {1}, {2}, {3}, {4}) = {5}", hDc, pixelFormat, layerPlane, nBytes, plpd, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDescribePixelFormat function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="ipfd">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="cjpfd">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="ppfd">
		/// A <see cref="T:PIXELFORMATDESCRIPTOR"/>.
		/// </param>
		public static int DescribePixelFormat(IntPtr hdc, int ipfd, UInt32 cjpfd, out PIXELFORMATDESCRIPTOR ppfd) {
			int retvalue;
			unsafe {
				fixed (PIXELFORMATDESCRIPTOR* fp_ppfd = &ppfd)
				{
					if      (Delegates.pwglDescribePixelFormat != null)
						retvalue = (Delegates.pwglDescribePixelFormat(hdc, ipfd, cjpfd, fp_ppfd));
					else
						throw new InvalidOperationException("binding point DescribePixelFormat cannot be found");
				}
			}
			LogProc("wglDescribePixelFormat({0}, {1}, {2}, {3}) = {4}", hdc, ipfd, cjpfd, ppfd, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglEnumerateVideoCaptureDevicesNV function.
		/// </summary>
		/// <param name="hDc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="phDeviceList">
		/// A <see cref="T:System.IntPtr"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static UInt32 EnumerateVideoCaptureDevicesNV(IntPtr hDc, [Out] out IntPtr phDeviceList) {
			UInt32 retvalue;
			unsafe {
				fixed (IntPtr* fp_phDeviceList = &phDeviceList)
				{
					if      (Delegates.pwglEnumerateVideoCaptureDevicesNV != null)
						retvalue = (Delegates.pwglEnumerateVideoCaptureDevicesNV(hDc, fp_phDeviceList));
					else
						throw new InvalidOperationException("binding point EnumerateVideoCaptureDevicesNV cannot be found");
				}
			}
			LogProc("wglEnumerateVideoCaptureDevicesNV({0}, {1}) = {2}", hDc, phDeviceList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglEnumerateVideoDevicesNV function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="phDeviceList">
		/// A <see cref="T:System.IntPtr*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static int EnumerateVideoDevicesNV(IntPtr hDC, [Out] IntPtr[] phDeviceList) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_phDeviceList = phDeviceList)
				{
					if      (Delegates.pwglEnumerateVideoDevicesNV != null)
						retvalue = (Delegates.pwglEnumerateVideoDevicesNV(hDC, fp_phDeviceList));
					else
						throw new InvalidOperationException("binding point EnumerateVideoDevicesNV cannot be found");
				}
			}
			LogProc("wglEnumerateVideoDevicesNV({0}, {1}) = {2}", hDC, phDeviceList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglEnumGpuDevicesNV function.
		/// </summary>
		/// <param name="hGpu">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iDeviceIndex">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="lpGpuDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean EnumGpuDevicesNV(IntPtr hGpu, UInt32 iDeviceIndex, IntPtr lpGpuDevice) {
			Boolean retvalue;
			if      (Delegates.pwglEnumGpuDevicesNV != null)
				retvalue = (Delegates.pwglEnumGpuDevicesNV(hGpu, iDeviceIndex, lpGpuDevice));
			else
				throw new InvalidOperationException("binding point EnumGpuDevicesNV cannot be found");
			LogProc("wglEnumGpuDevicesNV({0}, {1}, {2}) = {3}", hGpu, iDeviceIndex, lpGpuDevice, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglEnumGpusFromAffinityDCNV function.
		/// </summary>
		/// <param name="hAffinityDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iGpuIndex">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="hGpu">
		/// A <see cref="T:System.IntPtr"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean EnumGpusFromAffinityDCNV(IntPtr hAffinityDC, UInt32 iGpuIndex, [Out] out IntPtr hGpu) {
			Boolean retvalue;
			unsafe {
				fixed (IntPtr* fp_hGpu = &hGpu)
				{
					if      (Delegates.pwglEnumGpusFromAffinityDCNV != null)
						retvalue = (Delegates.pwglEnumGpusFromAffinityDCNV(hAffinityDC, iGpuIndex, fp_hGpu));
					else
						throw new InvalidOperationException("binding point EnumGpusFromAffinityDCNV cannot be found");
				}
			}
			LogProc("wglEnumGpusFromAffinityDCNV({0}, {1}, {2}) = {3}", hAffinityDC, iGpuIndex, hGpu, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglEnumGpusNV function.
		/// </summary>
		/// <param name="iGpuIndex">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="phGpu">
		/// A <see cref="T:System.IntPtr"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean EnumGpusNV(UInt32 iGpuIndex, [Out] out IntPtr phGpu) {
			Boolean retvalue;
			unsafe {
				fixed (IntPtr* fp_phGpu = &phGpu)
				{
					if      (Delegates.pwglEnumGpusNV != null)
						retvalue = (Delegates.pwglEnumGpusNV(iGpuIndex, fp_phGpu));
					else
						throw new InvalidOperationException("binding point EnumGpusNV cannot be found");
				}
			}
			LogProc("wglEnumGpusNV({0}, {1}) = {2}", iGpuIndex, phGpu, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetContextGPUIDAMD function.
		/// </summary>
		/// <param name="hglrc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static UInt32 GetContextGPUIDAMD(IntPtr hglrc) {
			UInt32 retvalue;
			if      (Delegates.pwglGetContextGPUIDAMD != null)
				retvalue = (Delegates.pwglGetContextGPUIDAMD(hglrc));
			else
				throw new InvalidOperationException("binding point GetContextGPUIDAMD cannot be found");
			LogProc("wglGetContextGPUIDAMD({0}) = {1}", hglrc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetCurrentAssociatedContextAMD function.
		/// </summary>
		public static IntPtr GetCurrentAssociatedContextAMD() {
			IntPtr retvalue;
			if      (Delegates.pwglGetCurrentAssociatedContextAMD != null)
				retvalue = (Delegates.pwglGetCurrentAssociatedContextAMD());
			else
				throw new InvalidOperationException("binding point GetCurrentAssociatedContextAMD cannot be found");
			LogProc("wglGetCurrentAssociatedContextAMD()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetCurrentContext function.
		/// </summary>
		public static IntPtr GetCurrentContext() {
			IntPtr retvalue;
			if      (Delegates.pwglGetCurrentContext != null)
				retvalue = (Delegates.pwglGetCurrentContext());
			else
				throw new InvalidOperationException("binding point GetCurrentContext cannot be found");
			LogProc("wglGetCurrentContext()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetCurrentDC function.
		/// </summary>
		public static IntPtr GetCurrentDC() {
			IntPtr retvalue;
			if      (Delegates.pwglGetCurrentDC != null)
				retvalue = (Delegates.pwglGetCurrentDC());
			else
				throw new InvalidOperationException("binding point GetCurrentDC cannot be found");
			LogProc("wglGetCurrentDC()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetDefaultProcAddress function.
		/// </summary>
		/// <param name="lpszProc">
		/// A <see cref="T:System.String"/>.
		/// </param>
		public static Int32 GetDefaultProcAddress(string lpszProc) {
			Int32 retvalue;
			if      (Delegates.pwglGetDefaultProcAddress != null)
				retvalue = (Delegates.pwglGetDefaultProcAddress(lpszProc));
			else
				throw new InvalidOperationException("binding point GetDefaultProcAddress cannot be found");
			LogProc("wglGetDefaultProcAddress({0}) = {1}", lpszProc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetGPUIDsAMD function.
		/// </summary>
		/// <param name="maxCount">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="ids">
		/// A <see cref="T:System.UInt32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static UInt32 GetGPUIDAMD(UInt32 maxCount, [Out] UInt32[] ids) {
			UInt32 retvalue;
			unsafe {
				fixed (UInt32* fp_ids = ids)
				{
					if      (Delegates.pwglGetGPUIDsAMD != null)
						retvalue = (Delegates.pwglGetGPUIDsAMD(maxCount, fp_ids));
					else
						throw new InvalidOperationException("binding point GetGPUIDAMD cannot be found");
				}
			}
			LogProc("wglGetGPUIDsAMD({0}, {1}) = {2}", maxCount, ids, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetGPUInfoAMD function.
		/// </summary>
		/// <param name="id">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="property">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dataType">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="size">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		/// <param name="data">
		/// A <see cref="T:System.IntPtr"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Int32 GetGPUInfoAMD(UInt32 id, int property, int dataType, UInt32 size, [Out] object data) {
			Int32 retvalue;
			GCHandle pp_data = GCHandle.Alloc(data, GCHandleType.Pinned);
			try {
				if      (Delegates.pwglGetGPUInfoAMD != null)
					retvalue = (Delegates.pwglGetGPUInfoAMD(id, property, dataType, size, pp_data.AddrOfPinnedObject()));
				else
					throw new InvalidOperationException("binding point GetGPUInfoAMD cannot be found");
			} finally {
				pp_data.Free();
			}
			LogProc("wglGetGPUInfoAMD({0}, {1}, {2}, {3}, {4}) = {5}", id, property, dataType, size, data, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetLayerPaletteEntries function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iLayerPlane">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="iStart">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="cEntries">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="pcr">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static int GetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, out Int32 pcr) {
			int retvalue;
			unsafe {
				fixed (Int32* fp_pcr = &pcr)
				{
					if      (Delegates.pwglGetLayerPaletteEntries != null)
						retvalue = (Delegates.pwglGetLayerPaletteEntries(hdc, iLayerPlane, iStart, cEntries, fp_pcr));
					else
						throw new InvalidOperationException("binding point GetLayerPaletteEntries cannot be found");
				}
			}
			LogProc("wglGetLayerPaletteEntries({0}, {1}, {2}, {3}, {4}) = {5}", hdc, iLayerPlane, iStart, cEntries, pcr, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetPixelFormat function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static int GetPixelFormat(IntPtr hdc) {
			int retvalue;
			if      (Delegates.pwglGetPixelFormat != null)
				retvalue = (Delegates.pwglGetPixelFormat(hdc));
			else
				throw new InvalidOperationException("binding point GetPixelFormat cannot be found");
			LogProc("wglGetPixelFormat({0}) = {1}", hdc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetProcAddress function.
		/// </summary>
		/// <param name="lpszProc">
		/// A <see cref="T:System.String"/>.
		/// </param>
		public static Int32 GetProcAddress(string lpszProc) {
			Int32 retvalue;
			if      (Delegates.pwglGetProcAddress != null)
				retvalue = (Delegates.pwglGetProcAddress(lpszProc));
			else
				throw new InvalidOperationException("binding point GetProcAddress cannot be found");
			LogProc("wglGetProcAddress({0}) = {1}", lpszProc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetVideoDeviceNV function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="numDevices">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="hVideoDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetVideoDeviceNV(IntPtr hDC, int numDevices, [Out] out IntPtr hVideoDevice) {
			Boolean retvalue;
			unsafe {
				fixed (IntPtr* fp_hVideoDevice = &hVideoDevice)
				{
					if      (Delegates.pwglGetVideoDeviceNV != null)
						retvalue = (Delegates.pwglGetVideoDeviceNV(hDC, numDevices, fp_hVideoDevice));
					else
						throw new InvalidOperationException("binding point GetVideoDeviceNV cannot be found");
				}
			}
			LogProc("wglGetVideoDeviceNV({0}, {1}, {2}) = {3}", hDC, numDevices, hVideoDevice, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetVideoInfoNV function.
		/// </summary>
		/// <param name="hpVideoDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pulCounterOutputPbuffer">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="pulCounterOutputVideo">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetVideoInfoNV(IntPtr hpVideoDevice, [Out] out UInt32 pulCounterOutputPbuffer, [Out] out UInt32 pulCounterOutputVideo) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_pulCounterOutputPbuffer = &pulCounterOutputPbuffer)
				fixed (UInt32* fp_pulCounterOutputVideo = &pulCounterOutputVideo)
				{
					if      (Delegates.pwglGetVideoInfoNV != null)
						retvalue = (Delegates.pwglGetVideoInfoNV(hpVideoDevice, fp_pulCounterOutputPbuffer, fp_pulCounterOutputVideo));
					else
						throw new InvalidOperationException("binding point GetVideoInfoNV cannot be found");
				}
			}
			LogProc("wglGetVideoInfoNV({0}, {1}, {2}) = {3}", hpVideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglJoinSwapGroupNV function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="group">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean JoinSwapGroupNV(IntPtr hDC, UInt32 group) {
			Boolean retvalue;
			if      (Delegates.pwglJoinSwapGroupNV != null)
				retvalue = (Delegates.pwglJoinSwapGroupNV(hDC, group));
			else
				throw new InvalidOperationException("binding point JoinSwapGroupNV cannot be found");
			LogProc("wglJoinSwapGroupNV({0}, {1}) = {2}", hDC, group, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglLockVideoCaptureDeviceNV function.
		/// </summary>
		/// <param name="hDc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean LockVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice) {
			Boolean retvalue;
			if      (Delegates.pwglLockVideoCaptureDeviceNV != null)
				retvalue = (Delegates.pwglLockVideoCaptureDeviceNV(hDc, hDevice));
			else
				throw new InvalidOperationException("binding point LockVideoCaptureDeviceNV cannot be found");
			LogProc("wglLockVideoCaptureDeviceNV({0}, {1}) = {2}", hDc, hDevice, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglMakeAssociatedContextCurrentAMD function.
		/// </summary>
		/// <param name="hglrc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean MakeAssociatedContextCurrentAMD(IntPtr hglrc) {
			Boolean retvalue;
			if      (Delegates.pwglMakeAssociatedContextCurrentAMD != null)
				retvalue = (Delegates.pwglMakeAssociatedContextCurrentAMD(hglrc));
			else
				throw new InvalidOperationException("binding point MakeAssociatedContextCurrentAMD cannot be found");
			LogProc("wglMakeAssociatedContextCurrentAMD({0}) = {1}", hglrc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQueryCurrentContextNV function.
		/// </summary>
		/// <param name="iAttribute">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="piValue">
		/// A <see cref="T:System.Int32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QueryCurrentContextNV(int iAttribute, [Out] int[] piValue) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piValue = piValue)
				{
					if      (Delegates.pwglQueryCurrentContextNV != null)
						retvalue = (Delegates.pwglQueryCurrentContextNV(iAttribute, fp_piValue));
					else
						throw new InvalidOperationException("binding point QueryCurrentContextNV cannot be found");
				}
			}
			LogProc("wglQueryCurrentContextNV({0}, {1}) = {2}", iAttribute, piValue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQueryFrameCountNV function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="count">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QueryFrameCountNV(IntPtr hDC, [Out] out UInt32 count) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_count = &count)
				{
					if      (Delegates.pwglQueryFrameCountNV != null)
						retvalue = (Delegates.pwglQueryFrameCountNV(hDC, fp_count));
					else
						throw new InvalidOperationException("binding point QueryFrameCountNV cannot be found");
				}
			}
			LogProc("wglQueryFrameCountNV({0}, {1}) = {2}", hDC, count, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQueryMaxSwapGroupsNV function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="maxGroups">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="maxBarriers">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QueryMaxSwapGroupsNV(IntPtr hDC, [Out] out UInt32 maxGroups, [Out] out UInt32 maxBarriers) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_maxGroups = &maxGroups)
				fixed (UInt32* fp_maxBarriers = &maxBarriers)
				{
					if      (Delegates.pwglQueryMaxSwapGroupsNV != null)
						retvalue = (Delegates.pwglQueryMaxSwapGroupsNV(hDC, fp_maxGroups, fp_maxBarriers));
					else
						throw new InvalidOperationException("binding point QueryMaxSwapGroupsNV cannot be found");
				}
			}
			LogProc("wglQueryMaxSwapGroupsNV({0}, {1}, {2}) = {3}", hDC, maxGroups, maxBarriers, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQuerySwapGroupNV function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="group">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="barrier">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QuerySwapGroupNV(IntPtr hDC, [Out] out UInt32 group, [Out] out UInt32 barrier) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_group = &group)
				fixed (UInt32* fp_barrier = &barrier)
				{
					if      (Delegates.pwglQuerySwapGroupNV != null)
						retvalue = (Delegates.pwglQuerySwapGroupNV(hDC, fp_group, fp_barrier));
					else
						throw new InvalidOperationException("binding point QuerySwapGroupNV cannot be found");
				}
			}
			LogProc("wglQuerySwapGroupNV({0}, {1}, {2}) = {3}", hDC, group, barrier, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQueryVideoCaptureDeviceNV function.
		/// </summary>
		/// <param name="hDc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iAttribute">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="piValue">
		/// A <see cref="T:System.Int32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QueryVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice, int iAttribute, [Out] out int piValue) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piValue = &piValue)
				{
					if      (Delegates.pwglQueryVideoCaptureDeviceNV != null)
						retvalue = (Delegates.pwglQueryVideoCaptureDeviceNV(hDc, hDevice, iAttribute, fp_piValue));
					else
						throw new InvalidOperationException("binding point QueryVideoCaptureDeviceNV cannot be found");
				}
			}
			LogProc("wglQueryVideoCaptureDeviceNV({0}, {1}, {2}, {3}) = {4}", hDc, hDevice, iAttribute, piValue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglRealizeLayerPalette function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iLayerPlane">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="bRealize">
		/// A <see cref="T:System.Boolean"/>.
		/// </param>
		public static Boolean RealizeLayerPalette(IntPtr hdc, int iLayerPlane, Boolean bRealize) {
			Boolean retvalue;
			if      (Delegates.pwglRealizeLayerPalette != null)
				retvalue = (Delegates.pwglRealizeLayerPalette(hdc, iLayerPlane, bRealize));
			else
				throw new InvalidOperationException("binding point RealizeLayerPalette cannot be found");
			LogProc("wglRealizeLayerPalette({0}, {1}, {2}) = {3}", hdc, iLayerPlane, bRealize, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglReleaseVideoCaptureDeviceNV function.
		/// </summary>
		/// <param name="hDc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean ReleaseVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice) {
			Boolean retvalue;
			if      (Delegates.pwglReleaseVideoCaptureDeviceNV != null)
				retvalue = (Delegates.pwglReleaseVideoCaptureDeviceNV(hDc, hDevice));
			else
				throw new InvalidOperationException("binding point ReleaseVideoCaptureDeviceNV cannot be found");
			LogProc("wglReleaseVideoCaptureDeviceNV({0}, {1}) = {2}", hDc, hDevice, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglReleaseVideoDeviceNV function.
		/// </summary>
		/// <param name="hVideoDevice">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean ReleaseVideoDeviceNV(IntPtr hVideoDevice) {
			Boolean retvalue;
			if      (Delegates.pwglReleaseVideoDeviceNV != null)
				retvalue = (Delegates.pwglReleaseVideoDeviceNV(hVideoDevice));
			else
				throw new InvalidOperationException("binding point ReleaseVideoDeviceNV cannot be found");
			LogProc("wglReleaseVideoDeviceNV({0}) = {1}", hVideoDevice, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglReleaseVideoImageNV function.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iVideoBuffer">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static Boolean ReleaseVideoImageNV(IntPtr hPbuffer, int iVideoBuffer) {
			Boolean retvalue;
			if      (Delegates.pwglReleaseVideoImageNV != null)
				retvalue = (Delegates.pwglReleaseVideoImageNV(hPbuffer, iVideoBuffer));
			else
				throw new InvalidOperationException("binding point ReleaseVideoImageNV cannot be found");
			LogProc("wglReleaseVideoImageNV({0}, {1}) = {2}", hPbuffer, iVideoBuffer, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglResetFrameCountNV function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean ResetFrameCountNV(IntPtr hDC) {
			Boolean retvalue;
			if      (Delegates.pwglResetFrameCountNV != null)
				retvalue = (Delegates.pwglResetFrameCountNV(hDC));
			else
				throw new InvalidOperationException("binding point ResetFrameCountNV cannot be found");
			LogProc("wglResetFrameCountNV({0}) = {1}", hDC, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSendPbufferToVideoNV function.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iBufferType">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="pulCounterPbuffer">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="bBlock">
		/// A <see cref="T:System.Boolean"/>.
		/// </param>
		public static Boolean SendPbufferToVideoNV(IntPtr hPbuffer, int iBufferType, [Out] out UInt32 pulCounterPbuffer, Boolean bBlock) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_pulCounterPbuffer = &pulCounterPbuffer)
				{
					if      (Delegates.pwglSendPbufferToVideoNV != null)
						retvalue = (Delegates.pwglSendPbufferToVideoNV(hPbuffer, iBufferType, fp_pulCounterPbuffer, bBlock));
					else
						throw new InvalidOperationException("binding point SendPbufferToVideoNV cannot be found");
				}
			}
			LogProc("wglSendPbufferToVideoNV({0}, {1}, {2}, {3}) = {4}", hPbuffer, iBufferType, pulCounterPbuffer, bBlock, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSetLayerPaletteEntries function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iLayerPlane">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="iStart">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="cEntries">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="pcr">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static int SetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, out Int32 pcr) {
			int retvalue;
			unsafe {
				fixed (Int32* fp_pcr = &pcr)
				{
					if      (Delegates.pwglSetLayerPaletteEntries != null)
						retvalue = (Delegates.pwglSetLayerPaletteEntries(hdc, iLayerPlane, iStart, cEntries, fp_pcr));
					else
						throw new InvalidOperationException("binding point SetLayerPaletteEntries cannot be found");
				}
			}
			LogProc("wglSetLayerPaletteEntries({0}, {1}, {2}, {3}, {4}) = {5}", hdc, iLayerPlane, iStart, cEntries, pcr, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSetPixelFormat function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="ipfd">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="ppfd">
		/// A <see cref="T:PIXELFORMATDESCRIPTOR"/>.
		/// </param>
		public static Boolean SetPixelFormat(IntPtr hdc, int ipfd, out PIXELFORMATDESCRIPTOR ppfd) {
			Boolean retvalue;
			unsafe {
				fixed (PIXELFORMATDESCRIPTOR* fp_ppfd = &ppfd)
				{
					if      (Delegates.pwglSetPixelFormat != null)
						retvalue = (Delegates.pwglSetPixelFormat(hdc, ipfd, fp_ppfd));
					else
						throw new InvalidOperationException("binding point SetPixelFormat cannot be found");
				}
			}
			LogProc("wglSetPixelFormat({0}, {1}, {2}) = {3}", hdc, ipfd, ppfd, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSetStereoEmitterState3DL function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uState">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean SetStereoEmitterState3DL(IntPtr hDC, UInt32 uState) {
			Boolean retvalue;
			if      (Delegates.pwglSetStereoEmitterState3DL != null)
				retvalue = (Delegates.pwglSetStereoEmitterState3DL(hDC, uState));
			else
				throw new InvalidOperationException("binding point SetStereoEmitterState3DL cannot be found");
			LogProc("wglSetStereoEmitterState3DL({0}, {1}) = {2}", hDC, uState, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglShareLists function.
		/// </summary>
		/// <param name="hrcSrvShare">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="hrcSrvSource">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean ShareLists(IntPtr hrcSrvShare, IntPtr hrcSrvSource) {
			Boolean retvalue;
			if      (Delegates.pwglShareLists != null)
				retvalue = (Delegates.pwglShareLists(hrcSrvShare, hrcSrvSource));
			else
				throw new InvalidOperationException("binding point ShareLists cannot be found");
			LogProc("wglShareLists({0}, {1}) = {2}", hrcSrvShare, hrcSrvSource, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSwapBuffers function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean SwapBuffers(IntPtr hdc) {
			Boolean retvalue;
			if      (Delegates.pwglSwapBuffers != null)
				retvalue = (Delegates.pwglSwapBuffers(hdc));
			else
				throw new InvalidOperationException("binding point SwapBuffers cannot be found");
			LogProc("wglSwapBuffers({0}) = {1}", hdc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSwapLayerBuffers function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="fuFlags">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean SwapLayerBuffers(IntPtr hdc, UInt32 fuFlags) {
			Boolean retvalue;
			if      (Delegates.pwglSwapLayerBuffers != null)
				retvalue = (Delegates.pwglSwapLayerBuffers(hdc, fuFlags));
			else
				throw new InvalidOperationException("binding point SwapLayerBuffers cannot be found");
			LogProc("wglSwapLayerBuffers({0}, {1}) = {2}", hdc, fuFlags, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglUseFontBitmapsA function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="first">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="count">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="listBase">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static Boolean UseFontBitmapsA(IntPtr hDC, Int32 first, Int32 count, Int32 listBase) {
			Boolean retvalue;
			if      (Delegates.pwglUseFontBitmapsA != null)
				retvalue = (Delegates.pwglUseFontBitmapsA(hDC, first, count, listBase));
			else
				throw new InvalidOperationException("binding point UseFontBitmapsA cannot be found");
			LogProc("wglUseFontBitmapsA({0}, {1}, {2}, {3}) = {4}", hDC, first, count, listBase, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglUseFontBitmapsW function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="first">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="count">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="listBase">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static Boolean UseFontBitmapsW(IntPtr hDC, Int32 first, Int32 count, Int32 listBase) {
			Boolean retvalue;
			if      (Delegates.pwglUseFontBitmapsW != null)
				retvalue = (Delegates.pwglUseFontBitmapsW(hDC, first, count, listBase));
			else
				throw new InvalidOperationException("binding point UseFontBitmapsW cannot be found");
			LogProc("wglUseFontBitmapsW({0}, {1}, {2}, {3}) = {4}", hDC, first, count, listBase, retvalue);
			return (retvalue);
		}

		internal static partial class Delegates
		{
			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglBindSwapBarrierNV(UInt32 group, UInt32 barrier);
			internal static wglBindSwapBarrierNV pwglBindSwapBarrierNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglBindVideoCaptureDeviceNV(UInt32 uVideoSlot, IntPtr hDevice);
			internal static wglBindVideoCaptureDeviceNV pwglBindVideoCaptureDeviceNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglBindVideoDeviceNV(IntPtr hDC, UInt32 uVideoSlot, IntPtr hVideoDevice, int* piAttribList);
			internal static wglBindVideoDeviceNV pwglBindVideoDeviceNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglBindVideoImageNV(IntPtr hVideoDevice, IntPtr hPbuffer, int iVideoBuffer);
			internal static wglBindVideoImageNV pwglBindVideoImageNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void wglBlitContextFramebufferAMD(IntPtr dstCtx, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, uint mask, int filter);
			internal static wglBlitContextFramebufferAMD pwglBlitContextFramebufferAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int wglChoosePixelFormat(IntPtr hDc, PIXELFORMATDESCRIPTOR* pPfd);
			internal static wglChoosePixelFormat pwglChoosePixelFormat = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglCopyContext(IntPtr hglrcSrc, IntPtr hglrcDst, UInt32 mask);
			internal static wglCopyContext pwglCopyContext = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglCopyImageSubDataNV(IntPtr hSrcRC, UInt32 srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, IntPtr hDstRC, UInt32 dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, Int32 width, Int32 height, Int32 depth);
			internal static wglCopyImageSubDataNV pwglCopyImageSubDataNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate IntPtr wglCreateAffinityDCNV(IntPtr* phGpuList);
			internal static wglCreateAffinityDCNV pwglCreateAffinityDCNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglCreateAssociatedContextAMD(UInt32 id);
			internal static wglCreateAssociatedContextAMD pwglCreateAssociatedContextAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate IntPtr wglCreateAssociatedContextAttribsAMD(UInt32 id, IntPtr hShareContext, int* attribList);
			internal static wglCreateAssociatedContextAttribsAMD pwglCreateAssociatedContextAttribsAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglCreateContext(IntPtr hDc);
			internal static wglCreateContext pwglCreateContext = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglCreateLayerContext(IntPtr hDc, int level);
			internal static wglCreateLayerContext pwglCreateLayerContext = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglDeleteAssociatedContextAMD(IntPtr hglrc);
			internal static wglDeleteAssociatedContextAMD pwglDeleteAssociatedContextAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglDeleteContext(IntPtr oldContext);
			internal static wglDeleteContext pwglDeleteContext = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglDeleteDCNV(IntPtr hdc);
			internal static wglDeleteDCNV pwglDeleteDCNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglDescribeLayerPlane(IntPtr hDc, int pixelFormat, int layerPlane, UInt32 nBytes, IntPtr* plpd);
			internal static wglDescribeLayerPlane pwglDescribeLayerPlane = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int wglDescribePixelFormat(IntPtr hdc, int ipfd, UInt32 cjpfd, PIXELFORMATDESCRIPTOR* ppfd);
			internal static wglDescribePixelFormat pwglDescribePixelFormat = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate UInt32 wglEnumerateVideoCaptureDevicesNV(IntPtr hDc, [Out] IntPtr* phDeviceList);
			internal static wglEnumerateVideoCaptureDevicesNV pwglEnumerateVideoCaptureDevicesNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int wglEnumerateVideoDevicesNV(IntPtr hDC, [Out] IntPtr* phDeviceList);
			internal static wglEnumerateVideoDevicesNV pwglEnumerateVideoDevicesNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglEnumGpuDevicesNV(IntPtr hGpu, UInt32 iDeviceIndex, IntPtr lpGpuDevice);
			internal static wglEnumGpuDevicesNV pwglEnumGpuDevicesNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglEnumGpusFromAffinityDCNV(IntPtr hAffinityDC, UInt32 iGpuIndex, [Out] IntPtr* hGpu);
			internal static wglEnumGpusFromAffinityDCNV pwglEnumGpusFromAffinityDCNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglEnumGpusNV(UInt32 iGpuIndex, [Out] IntPtr* phGpu);
			internal static wglEnumGpusNV pwglEnumGpusNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate UInt32 wglGetContextGPUIDAMD(IntPtr hglrc);
			internal static wglGetContextGPUIDAMD pwglGetContextGPUIDAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglGetCurrentAssociatedContextAMD();
			internal static wglGetCurrentAssociatedContextAMD pwglGetCurrentAssociatedContextAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglGetCurrentContext();
			internal static wglGetCurrentContext pwglGetCurrentContext = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglGetCurrentDC();
			internal static wglGetCurrentDC pwglGetCurrentDC = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Int32 wglGetDefaultProcAddress(string lpszProc);
			internal static wglGetDefaultProcAddress pwglGetDefaultProcAddress = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate UInt32 wglGetGPUIDsAMD(UInt32 maxCount, [Out] UInt32* ids);
			internal static wglGetGPUIDsAMD pwglGetGPUIDsAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Int32 wglGetGPUInfoAMD(UInt32 id, int property, int dataType, UInt32 size, [Out] IntPtr data);
			internal static wglGetGPUInfoAMD pwglGetGPUInfoAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int wglGetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32* pcr);
			internal static wglGetLayerPaletteEntries pwglGetLayerPaletteEntries = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate int wglGetPixelFormat(IntPtr hdc);
			internal static wglGetPixelFormat pwglGetPixelFormat = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Int32 wglGetProcAddress(string lpszProc);
			internal static wglGetProcAddress pwglGetProcAddress = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetVideoDeviceNV(IntPtr hDC, int numDevices, [Out] IntPtr* hVideoDevice);
			internal static wglGetVideoDeviceNV pwglGetVideoDeviceNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetVideoInfoNV(IntPtr hpVideoDevice, [Out] UInt32* pulCounterOutputPbuffer, [Out] UInt32* pulCounterOutputVideo);
			internal static wglGetVideoInfoNV pwglGetVideoInfoNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglJoinSwapGroupNV(IntPtr hDC, UInt32 group);
			internal static wglJoinSwapGroupNV pwglJoinSwapGroupNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglLockVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice);
			internal static wglLockVideoCaptureDeviceNV pwglLockVideoCaptureDeviceNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglMakeAssociatedContextCurrentAMD(IntPtr hglrc);
			internal static wglMakeAssociatedContextCurrentAMD pwglMakeAssociatedContextCurrentAMD = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglMakeCurrent(IntPtr hDc, IntPtr newContext);
			internal static wglMakeCurrent pwglMakeCurrent = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQueryCurrentContextNV(int iAttribute, [Out] int* piValue);
			internal static wglQueryCurrentContextNV pwglQueryCurrentContextNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQueryFrameCountNV(IntPtr hDC, [Out] UInt32* count);
			internal static wglQueryFrameCountNV pwglQueryFrameCountNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQueryMaxSwapGroupsNV(IntPtr hDC, [Out] UInt32* maxGroups, [Out] UInt32* maxBarriers);
			internal static wglQueryMaxSwapGroupsNV pwglQueryMaxSwapGroupsNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQuerySwapGroupNV(IntPtr hDC, [Out] UInt32* group, [Out] UInt32* barrier);
			internal static wglQuerySwapGroupNV pwglQuerySwapGroupNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQueryVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice, int iAttribute, [Out] int* piValue);
			internal static wglQueryVideoCaptureDeviceNV pwglQueryVideoCaptureDeviceNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglRealizeLayerPalette(IntPtr hdc, int iLayerPlane, Boolean bRealize);
			internal static wglRealizeLayerPalette pwglRealizeLayerPalette = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglReleaseVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice);
			internal static wglReleaseVideoCaptureDeviceNV pwglReleaseVideoCaptureDeviceNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglReleaseVideoDeviceNV(IntPtr hVideoDevice);
			internal static wglReleaseVideoDeviceNV pwglReleaseVideoDeviceNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglReleaseVideoImageNV(IntPtr hPbuffer, int iVideoBuffer);
			internal static wglReleaseVideoImageNV pwglReleaseVideoImageNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglResetFrameCountNV(IntPtr hDC);
			internal static wglResetFrameCountNV pwglResetFrameCountNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglSendPbufferToVideoNV(IntPtr hPbuffer, int iBufferType, [Out] UInt32* pulCounterPbuffer, Boolean bBlock);
			internal static wglSendPbufferToVideoNV pwglSendPbufferToVideoNV = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int wglSetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32* pcr);
			internal static wglSetLayerPaletteEntries pwglSetLayerPaletteEntries = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglSetPixelFormat(IntPtr hdc, int ipfd, PIXELFORMATDESCRIPTOR* ppfd);
			internal static wglSetPixelFormat pwglSetPixelFormat = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglSetStereoEmitterState3DL(IntPtr hDC, UInt32 uState);
			internal static wglSetStereoEmitterState3DL pwglSetStereoEmitterState3DL = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglShareLists(IntPtr hrcSrvShare, IntPtr hrcSrvSource);
			internal static wglShareLists pwglShareLists = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglSwapBuffers(IntPtr hdc);
			internal static wglSwapBuffers pwglSwapBuffers = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglSwapLayerBuffers(IntPtr hdc, UInt32 fuFlags);
			internal static wglSwapLayerBuffers pwglSwapLayerBuffers = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglUseFontBitmapsA(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
			internal static wglUseFontBitmapsA pwglUseFontBitmapsA = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglUseFontBitmapsW(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
			internal static wglUseFontBitmapsW pwglUseFontBitmapsW = null;

		}

		internal static partial class Imports
		{
			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglBindSwapBarrierNV", ExactSpelling = true)]
			internal extern static Boolean wglBindSwapBarrierNV(UInt32 group, UInt32 barrier);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglBindVideoCaptureDeviceNV", ExactSpelling = true)]
			internal extern static Boolean wglBindVideoCaptureDeviceNV(UInt32 uVideoSlot, IntPtr hDevice);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglBindVideoDeviceNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglBindVideoDeviceNV(IntPtr hDC, UInt32 uVideoSlot, IntPtr hVideoDevice, int* piAttribList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglBindVideoImageNV", ExactSpelling = true)]
			internal extern static Boolean wglBindVideoImageNV(IntPtr hVideoDevice, IntPtr hPbuffer, int iVideoBuffer);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglBlitContextFramebufferAMD", ExactSpelling = true)]
			internal extern static void wglBlitContextFramebufferAMD(IntPtr dstCtx, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, uint mask, int filter);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglChoosePixelFormat", ExactSpelling = true)]
			internal extern static unsafe int wglChoosePixelFormat(IntPtr hDc, PIXELFORMATDESCRIPTOR pPfd);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCopyContext", ExactSpelling = true)]
			internal extern static Boolean wglCopyContext(IntPtr hglrcSrc, IntPtr hglrcDst, UInt32 mask);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCopyImageSubDataNV", ExactSpelling = true)]
			internal extern static Boolean wglCopyImageSubDataNV(IntPtr hSrcRC, UInt32 srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, IntPtr hDstRC, UInt32 dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, Int32 width, Int32 height, Int32 depth);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCreateAffinityDCNV", ExactSpelling = true)]
			internal extern static unsafe IntPtr wglCreateAffinityDCNV(IntPtr* phGpuList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCreateAssociatedContextAMD", ExactSpelling = true)]
			internal extern static IntPtr wglCreateAssociatedContextAMD(UInt32 id);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCreateAssociatedContextAttribsAMD", ExactSpelling = true)]
			internal extern static unsafe IntPtr wglCreateAssociatedContextAttribsAMD(UInt32 id, IntPtr hShareContext, int* attribList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCreateContext", ExactSpelling = true)]
			internal extern static IntPtr wglCreateContext(IntPtr hDc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCreateLayerContext", ExactSpelling = true)]
			internal extern static IntPtr wglCreateLayerContext(IntPtr hDc, int level);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDeleteAssociatedContextAMD", ExactSpelling = true)]
			internal extern static Boolean wglDeleteAssociatedContextAMD(IntPtr hglrc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDeleteContext", ExactSpelling = true)]
			internal extern static Boolean wglDeleteContext(IntPtr oldContext);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDeleteDCNV", ExactSpelling = true)]
			internal extern static Boolean wglDeleteDCNV(IntPtr hdc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDescribeLayerPlane", ExactSpelling = true)]
			internal extern static unsafe Boolean wglDescribeLayerPlane(IntPtr hDc, int pixelFormat, int layerPlane, UInt32 nBytes, IntPtr plpd);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDescribePixelFormat", ExactSpelling = true)]
			internal extern static unsafe int wglDescribePixelFormat(IntPtr hdc, int ipfd, UInt32 cjpfd, PIXELFORMATDESCRIPTOR ppfd);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglEnumerateVideoCaptureDevicesNV", ExactSpelling = true)]
			internal extern static unsafe UInt32 wglEnumerateVideoCaptureDevicesNV(IntPtr hDc, [Out]IntPtr phDeviceList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglEnumerateVideoDevicesNV", ExactSpelling = true)]
			internal extern static unsafe int wglEnumerateVideoDevicesNV(IntPtr hDC, [Out]IntPtr* phDeviceList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglEnumGpuDevicesNV", ExactSpelling = true)]
			internal extern static Boolean wglEnumGpuDevicesNV(IntPtr hGpu, UInt32 iDeviceIndex, IntPtr lpGpuDevice);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglEnumGpusFromAffinityDCNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglEnumGpusFromAffinityDCNV(IntPtr hAffinityDC, UInt32 iGpuIndex, [Out]IntPtr hGpu);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglEnumGpusNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglEnumGpusNV(UInt32 iGpuIndex, [Out]IntPtr phGpu);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetContextGPUIDAMD", ExactSpelling = true)]
			internal extern static UInt32 wglGetContextGPUIDAMD(IntPtr hglrc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetCurrentAssociatedContextAMD", ExactSpelling = true)]
			internal extern static IntPtr wglGetCurrentAssociatedContextAMD();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetCurrentContext", ExactSpelling = true)]
			internal extern static IntPtr wglGetCurrentContext();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetCurrentDC", ExactSpelling = true)]
			internal extern static IntPtr wglGetCurrentDC();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetDefaultProcAddress", ExactSpelling = true)]
			internal extern static Int32 wglGetDefaultProcAddress(string lpszProc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetGPUIDsAMD", ExactSpelling = true)]
			internal extern static unsafe UInt32 wglGetGPUIDsAMD(UInt32 maxCount, [Out]UInt32* ids);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetGPUInfoAMD", ExactSpelling = true)]
			internal extern static Int32 wglGetGPUInfoAMD(UInt32 id, int property, int dataType, UInt32 size, [Out]IntPtr data);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetLayerPaletteEntries", ExactSpelling = true)]
			internal extern static unsafe int wglGetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32 pcr);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetPixelFormat", ExactSpelling = true)]
			internal extern static int wglGetPixelFormat(IntPtr hdc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetProcAddress", ExactSpelling = true)]
			internal extern static Int32 wglGetProcAddress(string lpszProc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetVideoDeviceNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetVideoDeviceNV(IntPtr hDC, int numDevices, [Out]IntPtr hVideoDevice);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetVideoInfoNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetVideoInfoNV(IntPtr hpVideoDevice, [Out]UInt32 pulCounterOutputPbuffer, [Out]UInt32 pulCounterOutputVideo);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglJoinSwapGroupNV", ExactSpelling = true)]
			internal extern static Boolean wglJoinSwapGroupNV(IntPtr hDC, UInt32 group);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglLockVideoCaptureDeviceNV", ExactSpelling = true)]
			internal extern static Boolean wglLockVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglMakeAssociatedContextCurrentAMD", ExactSpelling = true)]
			internal extern static Boolean wglMakeAssociatedContextCurrentAMD(IntPtr hglrc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglMakeCurrent", ExactSpelling = true)]
			internal extern static Boolean wglMakeCurrent(IntPtr hDc, IntPtr newContext);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQueryCurrentContextNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQueryCurrentContextNV(int iAttribute, [Out]int* piValue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQueryFrameCountNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQueryFrameCountNV(IntPtr hDC, [Out]UInt32 count);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQueryMaxSwapGroupsNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQueryMaxSwapGroupsNV(IntPtr hDC, [Out]UInt32 maxGroups, [Out]UInt32 maxBarriers);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQuerySwapGroupNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQuerySwapGroupNV(IntPtr hDC, [Out]UInt32 group, [Out]UInt32 barrier);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQueryVideoCaptureDeviceNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQueryVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice, int iAttribute, [Out]int piValue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglRealizeLayerPalette", ExactSpelling = true)]
			internal extern static Boolean wglRealizeLayerPalette(IntPtr hdc, int iLayerPlane, Boolean bRealize);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglReleaseVideoCaptureDeviceNV", ExactSpelling = true)]
			internal extern static Boolean wglReleaseVideoCaptureDeviceNV(IntPtr hDc, IntPtr hDevice);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglReleaseVideoDeviceNV", ExactSpelling = true)]
			internal extern static Boolean wglReleaseVideoDeviceNV(IntPtr hVideoDevice);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglReleaseVideoImageNV", ExactSpelling = true)]
			internal extern static Boolean wglReleaseVideoImageNV(IntPtr hPbuffer, int iVideoBuffer);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglResetFrameCountNV", ExactSpelling = true)]
			internal extern static Boolean wglResetFrameCountNV(IntPtr hDC);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSendPbufferToVideoNV", ExactSpelling = true)]
			internal extern static unsafe Boolean wglSendPbufferToVideoNV(IntPtr hPbuffer, int iBufferType, [Out]UInt32 pulCounterPbuffer, Boolean bBlock);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSetLayerPaletteEntries", ExactSpelling = true)]
			internal extern static unsafe int wglSetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32 pcr);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSetPixelFormat", ExactSpelling = true)]
			internal extern static unsafe Boolean wglSetPixelFormat(IntPtr hdc, int ipfd, PIXELFORMATDESCRIPTOR ppfd);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSetStereoEmitterState3DL", ExactSpelling = true)]
			internal extern static Boolean wglSetStereoEmitterState3DL(IntPtr hDC, UInt32 uState);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglShareLists", ExactSpelling = true)]
			internal extern static Boolean wglShareLists(IntPtr hrcSrvShare, IntPtr hrcSrvSource);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSwapBuffers", ExactSpelling = true)]
			internal extern static Boolean wglSwapBuffers(IntPtr hdc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSwapLayerBuffers", ExactSpelling = true)]
			internal extern static Boolean wglSwapLayerBuffers(IntPtr hdc, UInt32 fuFlags);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglUseFontBitmapsA", ExactSpelling = true)]
			internal extern static Boolean wglUseFontBitmapsA(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglUseFontBitmapsW", ExactSpelling = true)]
			internal extern static Boolean wglUseFontBitmapsW(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);

		}

	}
}
